/*
 * EnrollPayFailedActivity.java
 * business
 *
 * Created by chentao on 2017/4/21.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.main.discovery.enrollpayfailed;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.constant.Intents;
import com.yidiandao.business.utils.ActivityUtils;

/**
 * 报名失败 Activity.
 */
public class EnrollPayFailedActivity extends BaseActivity {

    private EnrollPayFailedFragment mPayAgainFragment;

    public static void actionStart(Activity activity, String actId) {
        Intent intent = new Intent(activity, EnrollPayFailedActivity.class);
        intent.putExtra(Intents.EXTRA_REC_ID, actId);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mPayAgainFragment = (EnrollPayFailedFragment) getSupportFragmentManager().findFragmentById(R.id.container_enroll_pay_again);

        if (mPayAgainFragment == null) {
            mPayAgainFragment = EnrollPayFailedFragment.getInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), mPayAgainFragment, R.id.container_enroll_pay_again);
        }

    }

    @Override
    protected void initPresenter() {
        new EnrollPayFailedPresenter(mPayAgainFragment, getIntent().getExtras().getString(Intents.EXTRA_REC_ID));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_enroll_pay_failed;
    }
}
